<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html>
<html>
<head>
<%@ include file="/common/links.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	$(document).ready(function() {
		$('#submit').click(function() {
			try{
			var subResult = $('#genEntityForm').ajaxSubmit(formOptions);
			return false;
			}catch(e){
				alert(e.message);
			}
		})
		$('#cancel').click(function() {
			closePopUpForm();
		})
		$("button").button();
		//$( "#demoEntity_dateField" ).datepicker(datePickerOptions);//TODO here init date field datepicker bind
		 jQuery("#genEntityForm").validationEngine({promptPosition : "centerRight"});
	});

</script>
</head>
<body>
	<fieldset>
		<legend>
			<c:if test="${editType==1}">
				<s:text name="genEntityNew.title" />
			</c:if>
			<c:if test="${editType==2}">
				<s:text name="genEntityEdit.title" />
			</c:if>
		</legend>
		<s:form id="genEntityForm" action="saveGenEntity" theme="xhtml" validate="false">
			<s:hidden name="gridId"/>
			<s:hidden name="editType"/>
			<s:hidden key="model.demoId"/>
			<s:textfield id="genEntity_bigDecimalField" key="genEntity.bigDecimalField" name="model.bigDecimalField" required="false" cssClass="validate[custom[number]]"/>
			<s:checkbox id="genEntity_booleanField" key="genEntity.booleanField" name="model.booleanField" />
			<s:checkbox id="genEntity_booleanObjField" key="genEntity.booleanObjField" name="model.booleanObjField" />
			<s:textfield id="genEntity_byteField" key="genEntity.byteField" name="model.byteField" required="true" cssClass="validate[required]"/>
			<s:textfield id="genEntity_byteObjField" key="genEntity.byteObjField" name="model.byteObjField" required="false" cssClass="validate[]"/>
			<s:textfield id="genEntity_charField" key="genEntity.charField" name="model.charField" required="true" cssClass="validate[required]"/>
			<s:textfield id="genEntity_charObjField" key="genEntity.charObjField" name="model.charObjField" required="false" cssClass="validate[]"/>
			<s:textfield id="genEntity_dateField" key="genEntity.dateField" name="model.dateField" required="false" cssClass="validate[custom[date]]"><s:param name="value"><s:date name="model.dateField" format="%{getText('date.format')}"/></s:param></s:textfield>
			<s:textfield id="genEntity_doubleField" key="genEntity.doubleField" name="model.doubleField" required="true" cssClass="validate[required,custom[number]]"/>
			<s:textfield id="genEntity_doubleObjField" key="genEntity.doubleObjField" name="model.doubleObjField" required="false" cssClass="validate[custom[number]]"/>
			<s:textfield id="genEntity_floatField" key="genEntity.floatField" name="model.floatField" required="true" cssClass="validate[required,custom[number]]"/>
			<s:textfield id="genEntity_floatObjField" key="genEntity.floatObjField" name="model.floatObjField" required="false" cssClass="validate[custom[number]]"/>
			<s:textfield id="genEntity_intField" key="genEntity.intField" name="model.intField" required="true" cssClass="validate[required,custom[integer]]"/>
			<s:textfield id="genEntity_intObjField" key="genEntity.intObjField" name="model.intObjField" required="false" cssClass="validate[custom[integer]]"/>
			<s:textfield id="genEntity_longField" key="genEntity.longField" name="model.longField" required="true" cssClass="validate[required,custom[integer]]"/>
			<s:textfield id="genEntity_longObjField" key="genEntity.longObjField" name="model.longObjField" required="false" cssClass="validate[custom[integer]]"/>
			<s:textfield id="genEntity_shortField" key="genEntity.shortField" name="model.shortField" required="true" cssClass="validate[required,custom[integer]]"/>
			<s:textfield id="genEntity_shortObjField" key="genEntity.shortObjField" name="model.shortObjField" required="false" cssClass="validate[custom[integer]]"/>
			<s:textfield id="genEntity_stringField" key="genEntity.stringField" name="model.stringField" required="false" cssClass="validate[]"/>
			<s:textfield id="genEntity_timestampField" key="genEntity.timestampField" name="model.timestampField" required="false" cssClass="validate[]"/>
		</s:form>
		<button name="submit" type="button" id="submit">
			<s:text name="button.save" />
		</button>
		<button name="cancel" type="button" id="cancel">
			<s:text name="button.cancel" />
		</button>
	</fieldset>
</body>
</html>





















